//
//  SYS_RemeberPwdCell.m
//  System_App
//
//  Created by 魏配军 on 2017/11/28.
//  Copyright © 2017年 czy001. All rights reserved.
//

#import "SYS_RemeberPwdCell.h"

@implementation SYS_RemeberPwdCell

-(instancetype)initWithTableView:(UITableView *)tableView  reuseId:(NSString *)reuseId
{
    
    SYS_RemeberPwdCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseId];
    if (!cell) {
        cell=[[SYS_RemeberPwdCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseId];
    }
    return cell;
}

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier];
    if (self) {
        [self addView];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    return self;
}

-(void) addView
{
    _iconImageView=[UIImageView new];
    
    _nameLabel=[[UILabel alloc]init];
    _nameLabel.textAlignment=NSTextAlignmentLeft;
    _nameLabel.font=[UIFont fontWithName:@"PingFangSC-Regular" size:13];
    _nameLabel.textColor=DGHColorAlpha(100, 100, 100, 1);
    
    _inputTextField=[SYS_CustomFiled new];
    _inputTextField.font=[UIFont systemFontOfSize:13];
    _inputTextField.textColor=DGHColorAlpha(100, 100, 100, 1);
    _inputTextField.tintColor=MainColor;
    _inputTextField.clearButtonMode =UITextFieldViewModeWhileEditing;
    _inputTextField.keyboardType=UIKeyboardTypeNumbersAndPunctuation;
    [_inputTextField setValue:DGHColor(221, 221, 221) forKeyPath:@"_placeholderLabel.textColor"];//修改颜色
    [_inputTextField setValue:[UIFont systemFontOfSize:11] forKeyPath:@"_placeholderLabel.font"];//修改字体
    
    _lineView=[UIView new];
    _lineView.backgroundColor=DGHColor(221, 221, 221);
    
    [self.contentView sd_addSubviews:@[_iconImageView,_nameLabel,_inputTextField,_lineView]];
    
    _iconImageView.sd_layout
    .leftSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 7)
    .widthIs(26)
    .heightIs(26);
    
    _nameLabel.sd_layout
    .leftSpaceToView(_iconImageView, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(60)
    .heightIs(20);
    
    _inputTextField.sd_layout
    .leftSpaceToView(_nameLabel, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(SCREENWIDTH-120)
    .heightIs(20);
    
    _lineView.sd_layout
    .leftSpaceToView(self.contentView, 0)
    .bottomEqualToView(self.contentView)
    .widthIs(SCREENWIDTH)
    .heightIs(0.5);
}

-(void)setIsPhoneText:(BOOL)isPhoneText
{
    _isPhoneText=isPhoneText;
    
    _inputTextField.sd_layout
    .leftSpaceToView(_nameLabel, 10)
    .topSpaceToView(self.contentView, 10)
    .widthIs(SCREENWIDTH-190)
    .heightIs(20);
}


@end
